Fix segfault writing ascii .vtu files with implicit cell type arrays
authorAnton Gladky <gladk@debian.org>
Tue, 28 Jul 2026 14:20:19 +0000 (16:20 +0200)
committerAnton Gladky <gladk@debian.org>
Tue, 28 Jul 2026 14:20:19 +0000 (16:20 +0200)
commitc0bf49c8ee22324b0f2daa9f57e3598e78b6e50d
tree83c2bfb68845050fc965e12aa4ff3bb9da2916ba
parentec7ceff8f88265d4dad3ed650efba1c72479596b
Fix segfault writing ascii .vtu files with implicit cell type arrays

Forwarded: not-yet

NewIterator() returns nullptr for the implicit cell-type arrays used
since VTK 9.6, so WriteAsciiData() dereferenced that nullptr in
iter->Delete(). Merely guarding the Delete() is not enough: the
templated writer already returns early on a null iterator, so the array
is then written empty, and since WriteInlineData() discards the return
value the writer reports success for a file which has lost all of its
cells. Write such arrays through an explicit copy instead.
Closes yade FTBFS.

Gbp-Pq: Name fix_xmlwriter_ascii_implicit_cellarray_segfault.patch
IO/XML/vtkXMLWriter.cxx